package com.lyc.mapper;

import com.lyc.pojo.UserFollows;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface FollowMapper {
    // 插入关注关系
    void insert(UserFollows userFollow);

    // 检查是否已关注
    boolean exists(@Param("followerId") Integer followerId, @Param("followingId") Integer followingId);

    // 删除关注关系
    void deleteByFollowerAndFollowing(@Param("followerId") Integer followerId, @Param("followingId") Integer followingId);

    // 查询用户关注列表
    List<UserFollows> selectFollowingList(@Param("userId") Integer userId);

    // 查询用户粉丝列表
    List<UserFollows> selectFollowerList(@Param("userId") Integer userId);
}
